﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="dialog_select_premium.aspx.cs" Inherits="Donal.Xms.Web.qianyi.dialog.dialog_select_premium" %>

<%@ Import Namespace="Donal.Xms.Common" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>选择差异价格设置</title>
    <link rel="stylesheet" type="text/css" href="../skin/icon/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/datepicker/WdatePicker.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
    <script src="../../scripts/jquery/jquery.cookie.js"></script>

    <script type="text/javascript">
        var api = top.dialog.get(window); //获取父窗体对象

        $(function () {

            let f = '<%=f%>';


            //设置按钮及事件
            api.button([{
                value: '确定',
                callback: function () {
                    submitForm();
                    return false;
                },
                autofocus: true
            }, {
                value: '取消',
                callback: function () {
                }
            }
            ]);

            function submitForm() {
                $("input[type='radio']:checked").each(function () {
                    var id = $(this).attr("id").replace("rbt", "");
                    var title = $("#hidName" + id).val();

                    if (f == '0') {
                        $(api.data).find("#txtGoods_or_category_txt").val(title);
                        $(api.data).find("[id$='hidgoods_product_category_id']").val(id);
                    } else {
                        $(api.data).find("#txtUser_or_group_txt").val(title);
                        $(api.data).find("[id$='hidUser_or_group_id']").val(id);
                    }

                    api.close().remove();
                });
            };

        });

    </script>
    <style>
        div.default {
            margin: 0;
            padding: 0;
            font-family: "Microsoft YaHei",Verdana;
            font-size: 12px;
        }

            div.default a, div.default span {
                display: block;
                float: left;
                margin: 2px 0 0 -1px;
                padding: 4px 12px;
                line-height: 20px;
                height: 20px;
                border: 1px solid #e1e1e1;
                background: #fff;
                color: #333;
                text-decoration: none;
            }

                div.default span:first-child {
                    border-left: 1px solid #e1e1e1;
                }

                div.default a:hover {
                    color: #666;
                    background: #eee;
                }

                div.default span.current {
                    color: #fff;
                    background: #488FCD;
                    border-color: #488FCD;
                }

                div.default span.disabled {
                    color: #999;
                    background: #fff;
                }

        .keywords {
            margin: 1px;
            padding: 4px;
            min-height: 20px;
            line-height: 20px;
            border: 1px solid #eee;
            background: #fff;
            vertical-align: middle;
        }
    </style>

</head>


<body>
    <form id="form1" runat="server">

        <div id="divIsUser" runat="server" visible="false">
            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="l-list">

                            <div class="menu-list">
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlIndustry" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlIndustry_SelectedIndexChanged">
                                        <asp:ListItem Value=" ">所有行业</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlGroupId" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlGroupId_SelectedIndexChanged"></asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
                                        <asp:ListItem Value=" ">所有状态</asp:ListItem>
                                        <asp:ListItem Value="1">正常</asp:ListItem>
                                        <asp:ListItem Value="2">禁用</asp:ListItem>
                                        <asp:ListItem Value="3">待审核</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlMonthly" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlMonthly_SelectedIndexChanged">
                                        <asp:ListItem Value=" ">月结类型</asp:ListItem>
                                        <asp:ListItem Value="1">月结</asp:ListItem>
                                        <asp:ListItem Value="2">普通</asp:ListItem>
                                    </asp:DropDownList>
                                </div>


                                <asp:TextBox ID="txtStartTime" runat="server" Width="100px" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" placeholder="添加时间"></asp:TextBox>
                                -
                    <asp:TextBox ID="txtEndTime" runat="server" Width="100px" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" placeholder="添加时间"></asp:TextBox>
                                <style>
                                    .date-input {
                                        width: 100px;
                                    }
                                </style>
                            </div>
                        </div>
                        <div class="r-list">
                            <asp:TextBox ID="txtKeywords" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn-search" OnClick="btnSearch_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">
                <asp:Repeater ID="rptList" runat="server">
                    <HeaderTemplate>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                            <tr>
                                <th width="5%">选择</th>
                                <th width="10%">会员组</th>
                                <th align="left">会员全称</th>
                                <th width="20%">行业</th>
                                <th width="10%">月结</th>
                                <th width="10%">信用额度</th>
                                <th width="5%">状态</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <input type="radio" id="rbt<%#Eval("id")%>" name="1" style="vertical-align: middle;" />
                                <input type="hidden" id="hidName<%#Eval("id")%>" value='<%#Eval("companyName")%>' />
                            </td>
                            <td align="center"><%#new Donal.Xms.BLL.user_groups().GetTitle(Convert.ToInt32(Eval("group_id")))%></td>
                            <td align="left"><%#Eval("companyName")%></td>
                            <td align="center"><%#Eval("industry_title")%></td>
                            <td align="center"><%#Eval("user_type").ToString()=="1"?"是":"否"%></td>
                            <td align="center"><%#Eval("order_limit")%></td>
                            <td align="center"><%#GetUserStatus(Convert.ToInt32(Eval("status")))%></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <%#rptList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"7\">暂无会员信息</td></tr>" : ""%>
            </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <!--/列表-->
        </div>

        <div id="divIsUserGroup" runat="server" visible="false">
            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="r-list">
                            <asp:TextBox ID="txtGroupKey" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="LinkButton1" runat="server" CssClass="btn-search" OnClick="btnGroupSearch_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">
                <asp:Repeater ID="rptGroupList" runat="server">
                    <HeaderTemplate>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                            <tr>
                                <th width="8%">选择</th>
                                <th width="10%">组别名称</th>
                                <th width="8%">等级值</th>
                                <th width="9%">购物折扣</th>
                                <th width="8%">注册组</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <input type="radio" id="rbt<%#Eval("id")%>" name="1" style="vertical-align: middle;" />
                                <input type="hidden" id="hidName<%#Eval("id")%>" value='<%#Eval("title")%>' />
                            </td>
                            <td align="center"><%#Eval("title")%></td>
                            <td align="center"><%#Eval("grade")%></td>
                            <td align="center"><%#Eval("discount")%>%</td>
                            <td align="center"><%#Convert.ToInt32(Eval("is_default")) == 1 ? "√" : ""%></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <%#rptGroupList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"5\">暂无记录</td></tr>" : ""%>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <!--/列表-->
        </div>

        <div id="divIsGoods" runat="server" visible="false">
            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="l-list">                           
                            <div class="menu-list">
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlGoodsCategory" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlGoodsCategory_SelectedIndexChanged"></asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlGoodsProducts" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlGoodsProducts_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlGoodsStatus" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlGoodsStatus_SelectedIndexChanged">
                                        <asp:ListItem Value="0" Selected="True">所有状态</asp:ListItem>
                                        <asp:ListItem Value="1">上架</asp:ListItem>
                                        <asp:ListItem Value="2">下架</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                        <div class="r-list">
                            <asp:TextBox ID="txtGoodsKeywords" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="btnGoodsSearch" runat="server" CssClass="btn-search" OnClick="btnGoodsSearch_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">
                <!--文字列表-->
                <asp:Repeater ID="rptGoodsList" runat="server">
                    <HeaderTemplate>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                            <tr>
                                <th width="5%">选择</th>
                                <th width="10%">所属类别</th>
                                <th width="10%">所属产品</th>
                                <th width="10%">规格名称</th>
                                <th width="10%">上下架</th>
                                <th width="10%">价格</th>   
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <input type="radio" id="rbt<%#Eval("id")%>" name="1" style="vertical-align: middle;" />
                                <input type="hidden" id="hidName<%#Eval("id")%>" value='<%#Eval("title")%>' />
                            </td>
                            <td align="center"><%# Eval("category_title")%></td>
                            <td align="center"><%# Eval("product_title")%></td>
                            <td align="center"><%#Eval("title")%></td>
                            <td align="center"><%# Eval("status").ToString()=="0"?"上架":"下架"%></td>  
                            <td align="center"><%#Eval("sell_price")%></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <%#rptGoodsList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"6\">暂无记录</td></tr>" : ""%>
                </table>
                    </FooterTemplate>
                </asp:Repeater>
                <!--/文字列表-->
            </div>
            <!--/列表-->
        </div>

        <div id="divIsProduct" runat="server" visible="false">
            <!--工具栏-->
            <div id="floatHead" class="toolbar-wrap">
                <div class="toolbar">
                    <div class="box-wrap">
                        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
                        <div class="l-list">
                            <div class="menu-list">
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlProductCategory" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlProductCategory_SelectedIndexChanged"></asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlProperty" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlProperty_SelectedIndexChanged">
                                        <asp:ListItem Value="" Selected="True">所有属性</asp:ListItem>
                                        <asp:ListItem Value="isTop">置顶</asp:ListItem>
                                        <asp:ListItem Value="isRed">推荐</asp:ListItem>
                                        <asp:ListItem Value="isHot">热门</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="rule-single-select">
                                    <asp:DropDownList ID="ddlProductStatus" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlProductStatus_SelectedIndexChanged">
                                        <asp:ListItem Value="0" Selected="True">所有状态</asp:ListItem>
                                        <asp:ListItem Value="1">上架</asp:ListItem>
                                        <asp:ListItem Value="2">下架</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                        <div class="r-list">
                            <asp:TextBox ID="txtProductKey" runat="server" CssClass="keyword" />
                            <asp:LinkButton ID="btnProductSearch" runat="server" CssClass="btn-search" OnClick="btnProductSearch_Click"><i class="iconfont icon-search"></i></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </div>
            <!--/工具栏-->

            <!--列表-->
            <div class="table-container">

                <asp:Repeater ID="rptProductList" runat="server">
                    <HeaderTemplate>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                            <tr>
                                <th width="5%">选择</th>
                                <th width="20%">标题</th>
                                <th width="15%">所属类别</th>
                                <th width="10%">发布时间</th>
                                <th width="10%">属性</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <input type="radio" id="rbt<%#Eval("id")%>" name="1" style="vertical-align: middle;" />
                                <input type="hidden" id="hidName<%#Eval("id")%>" value='<%#Eval("title")%>' />
                                <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                            </td>
                            <td align="center"><%#Eval("title")%></td>
                            <td align="center"><%#new Donal.Xms.BLL.products_category().GetTitle(Convert.ToInt32(Eval("category_id")))%></td>
                            <td align="center"><%#string.Format("{0:g}",Eval("add_time"))%></td>
                            <td align="center">
                                <div class="btn-tools">
                                    <a class='<%# Convert.ToInt32(Eval("is_top")) == 1 ? "selected" : ""%>' tooltip='<%# Convert.ToInt32(Eval("is_top")) == 1 ? "取消置顶" : "设置置顶"%>'><i class="iconfont icon-top"></i></a>
                                    <a class='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "selected" : ""%>' tooltip='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "取消推荐" : "设置推荐"%>'><i class="iconfont icon-good"></i></a>
                                    <a class='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "selected" : ""%>' tooltip='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "取消热门" : "设置热门"%>'><i class="iconfont icon-hot"></i></a>
                                </div>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <%#rptProductList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"5\">暂无记录</td></tr>" : ""%>
                </table>
                    </FooterTemplate>
                </asp:Repeater>

            </div>
            <!--/列表-->

        </div>

        <div id="divIsGoodsCategory" runat="server" visible="false">
            <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
            <style type="text/css">
                .tree-list .col-1 {
                    width: 6%;
                    text-align: center;
                }

                .tree-list .col-2 {
                    width: 6%;
                }

                .tree-list .col-3 {
                    width: 52%;
                }

                .tree-list .col-4 {
                    width: 12%;
                }

                .tree-list .col-5 {
                    width: 12%;
                }

                .tree-list .col-6 {
                    width: 12%;
                    text-align: center;
                }
            </style>
            <script type="text/javascript">
                $(function () {
                    initCategoryHtml('.tree-list', 1); //初始化分类的结构
                    $('.tree-list').initCategoryTree(true); //初始化分类的事件
                });
            </script>

            <!--列表-->
            <div class="table-container">
                <div class="tree-list">
                    <div class="thead">
                        <div class="col col-1">选择</div>
                        <div class="col col-2">编号</div>
                        <div class="col col-3">类别名称</div>
                        <div class="col col-4">调用别名</div>
                        <div class="col col-5">排序</div>
                    </div>
                    <ul>
                        <asp:Repeater ID="rptCategory" runat="server">
                            <ItemTemplate>
                                <li class="layer-<%#Eval("class_layer")%>">
                                    <div class="tbody">
                                        <div class="col col-1">
                                            <input type="radio" id="rbt<%#Eval("id")%>" name="1" style="vertical-align: middle;" />
                                            <input type="hidden" id="hidName<%#Eval("id")%>" value='<%#Eval("title")%>' />
                                        </div>
                                        <div class="col col-2"><%#Eval("id")%></div>
                                        <div class="col index col-3"><%#Eval("title")%></div>
                                        <div class="col col-4"><%#Eval("call_index")%></div>
                                        <div class="col col-5"><%#Eval("sort_id")%></div>
                                    </div>
                                </li>
                            </ItemTemplate>
                        </asp:Repeater>
                    </ul>
                </div>
            </div>
        </div>



        <!--内容底部-->
        <div class="line20"></div>
        <div class="pagelist" runat="server" visible="false" id="pagelist">
            <div class="l-btns">
                <span>显示</span><asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                    OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox><span>条/页</span>
            </div>
            <div id="PageContent" runat="server" class="default"></div>
        </div>
        <!--/内容底部-->

    </form>
</body>
</html>
